/*
 * @Description:
 * @Author: qingyang
 * @Date: 2023-06-28 15:01:54
 * @LastEditors: qingyang
 * @LastEditTime: 2023-06-28 16:56:43
 */
import type { RouteRecordRaw } from 'vue-router'

const loadComponent = (name: string) => {
  return () => import(/* webpackChunkName: "workbench" */ `@/views/${name}/index.vue`)
}

export const routes: Array<RouteRecordRaw> = [
  {
    path: 'workbench',
    component: loadComponent('workbench'),
    name: 'Workbench',
    meta: {
      title: '工作台',
      bgColor: '#F3F7FB',
      breadcrumb: [],
      activeMenu: '/workbench',
      showFooter: true
    }
  },
  {
    path: 'todo-list',
    component: loadComponent('todo'),
    name: 'TodoList',
    meta: {
      title: '待办中心',
      bgColor: '#F3F7FB',
      breadcrumb: [
        {
          name: '工作台',
          path: '/workbench'
        },
        {
          name: '待办中心',
          path: false
        }
      ],
      keepAlive: true,
      activeMenu: '/workbench'
    }
  },
  {
    path: '/todo-list/detail',
    component: loadComponent('todo/detail'),
    name: 'TodoListDetail',
    meta: {
      title: '待办详情',
      bgColor: '#EDF2F5',
      keepAliveParentName: ['TodoList', 'FillInTask'],
      breadcrumb: [
        {
          name: '工作台',
          path: '/workbench'
        },
        {
          name: '待办中心',
          path: '/todo-list'
        },
        {
          name: '详情',
          path: false
        }
      ],
      activeMenu: '/workbench'
    }
  }
]

export default routes
